$('.fa-trash-o').click(function () {
    swal({
        title: "你确定要删除吗？",
        text: "数据一旦删除，将无法恢复！",
        icon: "warning",
        buttons: true,
        dangerMode: true,
    })
        .then((willDelete) => {
            if (willDelete) {
                $.ajax({
                    url: $(this).attr('url'),
                    type: 'post',
                    success: (ret) => {
                        if (ret.status === 0) {
                            swal("哇哦，数据删除成功！", {
                                icon: "success",
                            });
                            $(this).parent().parent().parent().remove()
                        } else {
                            if (ret.msg) {
                                swal(ret.msg)
                            } else {
                                swal(ret)
                            }
                        }
                    },
                    error: function (ret) {
                        swal('error:' + ret)
                    }
                });
            } else {
                swal("数据没有被删除！");
            }
        });
});